﻿using BCDto.TMS.Agent.AgentApplicationRecord;
using BCService.TMS.Agent.AgentApplication;
using BCTMSRESTful.Configs;
using BCTMSRESTful.Controllers.Management;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.TMS.Agent
{
    /// <summary>
    /// 代理商申请记录
    /// </summary>
    [ApiExplorerSettings(GroupName = "TMS")]
    [Route("api/v1/sim/[controller]")]
    public class AgentApplicationRecordController : ManagementBaseController
    {
        private readonly IAgentApplicationRecordService agentApplicationRecordService;

        public AgentApplicationRecordController(IAgentApplicationRecordService agentApplicationRecordService)
        {
            this.agentApplicationRecordService = agentApplicationRecordService;
        }

        /// <summary>
        /// 添加代理商申请记录
        /// </summary>
        /// <param name="requestDto">代理商申请信息</param>
        /// <response code="201">添加代理商申请记录</response>
        /// <returns></returns>
        [HttpPost]
        [Log("添加代理商申请记录")]
        [ProducesResponseType(typeof(AgentApplicationRecordDto), 201)]
        public IActionResult Post([FromBody] AgentApplicationRequestDto requestDto)
        {
            var result = this.agentApplicationRecordService.Add(this.Admin, requestDto);
            return this.Ok(result);
        }
    }
}
